<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="root">
        <h2>今天天气很{{info}}</h2>
        <!-- <button @click="isHot = !isHot">切换天气</button> -->
        <button @click="changeWeather()">切换天气</button>
    </div>
</body>
<script>
    Vue.config.productionTip = false;
    new Vue({
        el: "#root",
        data: {
            isHot:true
        },
        methods: {
            changeWeather(){
                this.isHot = !this.isHot;
            }
        },
        computed:{
            info:{
                get(){
                    return this.isHot?"炎热":"凉爽";
                }
            }
        }
    })
</script>

</html>